import unittest

from WindProfile import *


class AllTests(unittest.TestCase):

    def test1(self):
        target_time = datetime.strptime("20240101004200", "%Y%m%d%H%M%S")
        files = scan_files("data", target_time)
        pass

    def test2(self):
        reader = RadReader("data/Z_RADA_I_51839_20240101003959_O_WPRD_LC_RAD.TXT")
        result = reader.parse(WindProfile("20240101003959"))
        pass

    def test3(self):
        u = np.array([100., 200., -300.])
        v = np.array([100., 0., 0.])
        d = np.arctan(u / v)
        pass

    def test4(self):
        arr = np.random.rand(10, 10)
        nan_indices = np.random.choice(arr.size, size=10, replace=False)  # 随机选择10个位置
        arr.flat[nan_indices] = np.nan
        indices = np.where(~np.isnan(arr))
        indices1 = np.where(arr[indices] >= .5)
        pass

    def test_through(self):
        output_file = calc_robs("data", "20240101004300")
        print(f"{output_file} 已经生成。")
        pass
